public class student1 extends Person1{
    public int no;
    public int scoreEn;
    public int scoreMath;
    public int scoreCh;

    public student1(String name, String sex, int age, int no, int scoreEn, int scoreMath, int scoreCh) {
        super(name, sex, age);
        this.no = no;
        this.scoreEn = scoreEn;
        this.scoreMath = scoreMath;
        this.scoreCh = scoreCh;
    }
    public float aver(){
        return (float)(scoreCh+scoreMath+scoreEn)/3;
    }
    public int max(){
        int max;
        if(scoreEn<scoreMath){
            max = scoreMath;
        }else{
            max = scoreEn;
        }
        if(max < scoreCh){
            max = scoreEn;
        }else{
            max = max;
        }
        return max;
    }
    public int min(){
        int min;
        min = scoreCh < scoreMath? scoreCh:scoreMath;
        min = min < scoreEn ? min:scoreEn;
        return min;
    }

    @Override
    public String toString() {
        return "student1{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", no=" + no +
                ", aver=" + aver() +
                ", min=" + min() +
                ", max=" + max() +
                '}';
    }
}
